package com.jeff.tianti.cms.dao;

import com.jeff.tianti.cms.entity.Article;
import com.jeff.tianti.common.dao.CommonDao;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.Map;

/**
 * @author xujianfang
 * @desc ArticleDao接口 
 * @date 2017-03-16
 */
public interface ArticleDao extends ArticleDaoCustom,CommonDao<Article,String>{
    @Query(value = "SELECT id,DATE_FORMAT(update_date,'%Y-%m-%d') as updateDate ,title FROM cms_article where update_date > ?1 and d.deleteFlag=0 and  is_audit =1", nativeQuery = true)
    Page<Map> findAllByUpdateDateAfter(Date updateDate, Pageable pageable);
}

